package corej.prj.commandlinebank.model;

import corej.prj.commandlinebank.exception.BalanceNotEnoughException;

public class SavingAccount extends Account {
    public SavingAccount() {
        super();
    }

    public SavingAccount(String password, String name, String personId,
                         String email) {
        super(password, name, personId, email);
    }

    public void withdraw(double money) throws BalanceNotEnoughException {
        if (getBalance() < money) {
            throw new BalanceNotEnoughException("�������");
        } else {
            this.setBalance(this.getBalance() - money);
        }
    }

}
